﻿using System.Windows;
using System.Windows.Input;
using Dubs_Finder.ViewModel;
using Dubs_Finder.Model;

namespace Dubs_Finder
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        /// <summary>
        /// Initializes a new instance of the MainWindow class.
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();
            Closing += (s, e) => ViewModelLocator.Cleanup();
        }

        public void ListViewDoubleClickCommand(object sender, MouseButtonEventArgs e)
        {
            var item = ((FrameworkElement)e.OriginalSource).DataContext as DubsWrapper;
            if (item != null)
            {
                MessageBox.Show("Item's Double Click handled!");
            }
        }
    }
}